<?php
$hasErrors = false;
foreach($forms as $form) {
  if($form->hasErrors()) {
    $hasErrors = true;
    break;
  }
}
if (count($global->getRawValue()) > 0) {
  $hasErrors = true;
}
if($hasErrors): ?>
<div class="content_inner">
<div class="<?php if(!$hasErrors): echo 'hidden'; endif; ?> error" id="jq_error_msgs">
  <ul class="error_list">
  <?php
  if (isset($global) && count($global)) {
    foreach($global as $e) {
      echo '<li>'.$e.'</li>';
    }
  }
  $shownErrors = array();
  foreach($forms as $form) {
    foreach($form as $error) {
      if  ($error->getError() && !in_array($error->getError(), $shownErrors)) {
        echo '<li>'.$error->getError().'</li>';
        $shownErrors[] = $error->getError();
      }
    }
  }
  ?>
  </ul>
</div>
</div>
<?php endif; ?>